const { Random } = require("mockjs");
const baseUrl = "/api/user";

module.exports = [
  // 获取用户信息
  {
    url: `${baseUrl}/info`,
    method: "get",
    response() {
      return {
        code: 0,
        result: {
          userName: Random.name(),
          nickName: Random.cname(),
        },
        // code: 100,
        // msg: "获取用户信息失败",
      };
    },
  },
  // 注册
  {
    url: `${baseUrl}/register`,
    method: "post",
    response() {
      return {
        code: 0,
      };
    },
  },
  // 登录
  {
    url: `${baseUrl}/login`,
    method: "post",
    response() {
      return {
        code: 0,
        result: {
          token: Random.word(128),
          userName: Random.name(),
          nickName: Random.cname(),
        },
      };
    },
  },
];
